Ruby program to demonstrate the bitwise right-shift (>>) operator

bookmark

num1=16
num2=2
res =0

res = num1 >> num2;

print num1," >> ", num2," = ",res

 


Output:

16 >> 2 = 4